/************************************************************************

								Heroes IV
					  Copyright 2001, The 3DO Company

	------------------------------------------------------------------
  							link_type.cpp

	$Header: $

	$NoKeywords: $

 ************************************************************************/

#include "precompiled.h"
#include "link_type.h"

#include "enum_operations.h"
#include "string_insensitive_compare.h"

char const* const k_link_type_keyword[k_link_type_count] =
{
	"none",
	"player",
	"town"
};


// ------------------------------------------------------------------------------
// Given a keyword, return the link type for that keyword
// ------------------------------------------------------------------------------
t_random_object_link_type get_link_type( std::string const& keyword )
{
	// Not worth creating a map for just three entries...
	for (t_random_object_link_type type = t_random_object_link_type(0); type < k_link_type_count; enum_incr(type))
	{
		if (string_insensitive_compare(k_link_type_keyword[type], keyword) == 0)
			return type;
	}

	return k_link_type_none;
}

